package com.training.string;

public class StringDemo {
	public static void main(String[] args) {
		String str = " hello java ,it's a great Language   ";
		/*
		 * charAt(index)
		 */
		System.out.println(str.charAt(7));
		/*
		 * startWith
		 */
		System.out.println(str.startsWith("hello"));
		System.out.println(str.startsWith("helloz"));
		/*
		 * endWith
		 */
		System.out.println(str.endsWith("language"));
		/*
		 * indexOf()
		 */
		System.out.println(str.indexOf("h"));
		/*
		 * subString()
		 */
		System.out.println(str.substring(2,7));//左闭右开
		/*
		 * replace
		 */
		System.out.println(str.replace("a", "*"));
		/*
		 * contains
		 */
		System.out.println(str.contains("hello"));
		/*
		 * 大小写转换
		 * toUpperCase
		 * toLowerCase
		 */
		System.out.println(str.toUpperCase());
		System.out.println(str.toLowerCase());
		/*
		 * trim()
		 */
		System.out.println(str.trim());
		
		System.out.println(str);
	}
}
